package com.it.gw.modules.station.adapter

import DictVo
import android.annotation.SuppressLint
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.RecyclerView
import com.it.common.utils.DateUtils
import com.it.common.utils.StringUtils
import com.it.common.utils.isNotEmpty
import com.it.gw.databinding.ItemGqStationInfoBinding
import com.it.gw.modules.station.activity.GQStationInfoActivity
import kotlinx.coroutines.launch


class GQDictVoAdapter(
    var context: GQStationInfoActivity,
    var listener: (DictVo) -> Unit,
    var datas: List<DictVo>
) : RecyclerView.Adapter<GQDictVoAdapter.ViewHolder>() {
    companion object {
        const val TAG = "GQStationListAdapter"
    }

    override fun onCreateViewHolder(
        parent: ViewGroup,
        viewType: Int
    ): ViewHolder {
        val binding = ItemGqStationInfoBinding.inflate(LayoutInflater.from(parent.context))
        return ViewHolder(binding)
    }


    override fun onBindViewHolder(holder: ViewHolder, @SuppressLint("RecyclerView") position: Int) {
        holder.binding.value1.setTag(position)
        val data = datas.get(position)
        Log.d(TAG, "onBindViewHolder:${data.dataName}  and  ${data.model} and ${data.dataValue}")



    }

    override fun getItemCount() = datas.size

    class ViewHolder(val binding: ItemGqStationInfoBinding) : RecyclerView.ViewHolder(binding.root)
}